package org.linlinjava.litemall.admin.util;

import org.linlinjava.litemall.db.domain.LitemallRegion;

import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;

public class Children {
    public String value;
    public String label;
    public List<Children> children;

    public Children(){};
    public Children(LitemallRegion region) {
        this.value = region.getCode() + "";
        this.label = region.getName();
    }
    void addChildren(Children children) {
        if (this.children != null) {
            this.children.add(children);
        }
        else {
            List<Children> childrenList = new LinkedList<>();
            childrenList.add(children);
            this.children = childrenList;
        }
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public List<Children> getChildren() {
        return children;
    }

    public void setChildren(List<Children> children) {
        this.children = children;
    }
}
